package com.goldcn.sys.dao;

import com.goldcn.sys.model.GcnSysPage;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;


public interface GcnSysPageMapper {
	int deleteByPrimaryKey(String pageID);

	int insert(GcnSysPage record);

	int insertSelective(GcnSysPage record);

	GcnSysPage selectByPrimaryKey(String pageID);

	int updateByPrimaryKeySelective(GcnSysPage record);

	int updateByPrimaryKey(GcnSysPage record);

	/**
	 * 过滤出角色的一级菜单
	 * @param map @key
	 * rolePages，accountID
	 * @return
	 */
	List<GcnSysPage> queryTopInPages(Map<String, Object> map);

	/**
	 * 过滤出角色的子菜单
	 * @param map @key
	 * rolePages，accountID，parentID
	 * @return
	 */
	List<GcnSysPage> queryChildrenInPages(Map<String, Object> map);

	List<GcnSysPage> selectAll(@Param(value = "condition") String condition);

	List<GcnSysPage> getPageList(@Param(value = "condition") String condition);

	int updateBatch(@Param(value = "isStop") Integer isStop, @Param(value = "pageIDs") List<String> pageIDs);

	List<Map<String,String>> queryChildrenInParentID(@Param(value = "parentID") String parentID);

	List<Map<String,String>> getAllAndHasRole(@Param(value = "roleID") String roleID);

}